package com.nuvsoft.android.nuvgamenet.example.buzzer.activities;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.nuvsoft.android.nuvgamenet.R;
import com.nuvsoft.android.nuvgamenet.example.buzzer.BuzzerApplication;

public class Buzzer extends Activity {
	
	private BuzzerApplication ba;
	
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.main);
		
		ba = (BuzzerApplication) getApplication();
		
		Button b1 = (Button)findViewById(R.id.b_start_lobby);
		b1.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View arg0) {
				ba.getConnectionManager().startNewLobby();
				Intent myIntent = new Intent(Buzzer.this, BuzzerLobby.class);
				Buzzer.this.startActivity(myIntent);
			}
		});
		
		Button b2 = (Button)findViewById(R.id.b_join_lobby);
		b2.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View arg0) {
				Intent myIntent = new Intent(Buzzer.this, BuzzerLobbyList.class);
				Buzzer.this.startActivity(myIntent);
			}
		});
	}
	
}